package com.JdbcUtil;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class Stuinfo_DAO {

	public static Stuinfo insert(Stuinfo stu) throws SQLException{
		jdbcUtil jd = new jdbcUtil();
		try {
			Connection con = jd.getConnection();
			String sql = "insert into cgw_t_login(name,pwd) values(?,?)";
			PreparedStatement psm = con.prepareStatement(sql);
			psm.setString(1, stu.getName());
			psm.setString(2, stu.getPwd());
			psm.executeUpdate();
			psm.close();
			con.close();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		return stu;
	}
	
	
	
}
